package cart.domain;

import java.math.BigDecimal;

import vo.Commodity;


public class CartItem {
	private Commodity commodity; //单一餐品
	private int count; //当前总数
	
	public double getSubtotal(){//小计方法，是没有成员变量的
		BigDecimal b1 = new BigDecimal(commodity.getCommodityPrice() + "");
		BigDecimal b2 = new BigDecimal(count + "");
		return b1.multiply(b2).doubleValue();
	}
	

	public Commodity getCommodity() {
		return commodity;
	}

	public void setCommodity(Commodity commodity) {
		this.commodity = commodity;
	}


	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}
	
}
